Methods and apparatus for determining instantaneous elastic recoil and assistance pressure during ventilatory support

ABSTRACT

The apparatus provides for the determination of the instantaneous phase in the respiratory cycle, subject&#39;s average respiration rate and the provision of ventilatory assistance. A microprocessor ( 16 ) receives an airflow signal from a pressure transducer ( 18 ) coupled to a port ( 17 ) at a mask ( 11 ). The microprocessor ( 16 ) controls a servo ( 19 ), that in turn controls the fan motor ( 20 ) and thus the pressure of air delivered by the blower ( 10 ). The blower ( 10 ) is coupled to a subject&#39;s mask (ii) by a conduit ( 12 ). The invention seeks to address the following goals: while the subject is awake and making substantial efforts the delivered assistance should be closely matched in phase with the subject&#39;s efforts; the machine should automatically adjust the degree of assistance to maintain at least a specified minimum ventilation without relying on the integrity of the subject&#39;s chemoreflexes; and it should continue to work correctly in the pesence of large leaks.

This application is a continuation of co-pending U.S. patent applicationSer. No. 08/935,785, which was filed on Sep. 23, 1997.

FIELD OF THE INVENTION

The invention relates to methods and apparatus for the provision ofventilatory assistance matched to a subject's respiratory need. Theventilatory assistance can be for a subject who is either spontaneouslyor non-spontaneously breathing, or moves between these breathing states.The invention is especially suitable for, but not limited to,spontaneously breathing human subjects requiring longterm ventilatoryassistance, particularly during sleep

BACKGROUND OF THE INVENTION

Subjects with severe lung disease, chest wall disease, neuromusculardisease, or diseases of respiratory control may require in-hospitalmechanical ventilatory assistance, followed by longterm home mechanicalventilatory assistance, particularly during sleep. The ventilatordelivers air or air enriched with oxygen to the subject, via aninterface such as a nosemask, at a pressure that is higher duringinspiration and lower during expiration.

In the awake state, and while waiting to go to sleep, the subject'sventilatory pattern is variable in rate and depth. Most knownventilatory devices do not accurately match the amplitude and phase ofmask pressure to the subject's spontaneous efforts, leading todiscomfort or pac. Larger amounts of asynchrony also reduce theefficiency of the device. During sleep, thee are changes in the neuralcontrol of breathing as well as the mechanics of the subject's airways,respiratory muscles and chest wall, leading to a need for substantiallyincreased ventilatory support. Therefore, unless the device canautomatically adjust the degree of support, the amplitude of deliveredpressure will either be inadequate during sleep, or must be excessive inthe awake state. This is particularly important in subjects withabnormalities of respiratory control, for example centralhypoventilation syndromes, such as Obesity Hypoventilation Syndrome,where there is inadequate chemoreceptor drive, or Cheyne Stokesbreathing such as in patients with severe cardiac failure or after astroke, where there is excessive or unstable chemoreceptor drive.

Furthermore, during sleep there are inevitably large leaks between maskand subject, or at the subject's mouth if this is left free. Such leaksworsen the error in matching the phase and magnitude of the machine'seffort to the subject's needs, and, in the case of mouth leak, reducethe effectiveness of the ventilatory support.

Ideally a ventilatory assistance device should simultaneously addressthe following goals:

(i) While the subject is awake and making substantial ventilatoryefforts, the delivered assistance should be closely matched in phasewith the patient's efforts.

(ii) The machine should automatically adjust the degree of assistance tomaintain at least a specified ventilation, without relying on theintegrity of the subject's chemoreflexes.

(iii) It should continue to work correctly in the presence of largeleaks.

Most simple home ventilators either deliver a fixed volume, or cyclebetween two fixed pressures. They do so either at a fixed rate, or aretriggered by the patient's spontaneous efforts, or both. All such simpledevices fail to meet goal (ii) of adjusting the degree of assistance tomaintain at least a given ventilation. They also largely fail to meetgoal (i) of closely matching the subjects respiratory phase: timeddevices make no attempt to synchronize with the subject's efforts;triggered devices attempt to synchronize the start and end of the breathwith the subject's efforts, but make no attempt to tailor theinstantaneous pressure during a breath to the subject's efforts.Furthermore, the triggering tends to fail in the presence of leaks, thusfailing goal (iii).

The broad family of servo-ventilators known for at least 20 yearsmeasure ventilation and adjust the degree of assistance to maintainventilation at or above a specified level, thus goal (ii), but theystill fail to meet goal (i) of closely matching the phase of thesubject's spontaneous efforts, or the reasons given above. No attempt ismade to meet goal (iii).

Proportional assistist ventilation (PAV), as taught by Dr Magdy Younes,for example in Principles wad Practice of Mechanical Ventilation,chapter 15, aims to tailor the pressure vs time profile within a breathto partially or completely unload the subject's resistive and elasticwork, while minimizing the airway pressure required to achieve thedesired ventilation. During the inspiratory half-cycle, the administredpressure takes the form:

P(t)=P ₀ +R.f _(RESP)(t)+E.V(t)

where R is a percentage of the resistance of the airway, f_(RESP)(t) isthe instantaneous respiratory airflow at time t, E is a percentage ofthe elastance of lung and chest wall, and V(t) is the volume inspiredsince the start of inspiration to the present moment. During theexpiratory half-cycle, V(t) is taken as zero, to produce passiveexpiration.

An advantage of proportional assist ventilation during spontaneousbreathing is that the degree of assistance is automatically adjusted tosuit the subject's immediate needs and their pattern of breathing, andis therefore comfortable in the spontaneously breathing subject.However, there are at least two important disadvantages. Firstly, V(t)is calculated as the integral of flow with respect to time since thestart of inspiration. A disadvantage of calculating V(t) in this way isthat, in the presence of leaks, the integral of the flow through theleak will be included in V(t), resulting in an overestimation of V(t),in turn resulting in a runaway increase in the administered pressure.This can be distressing to the subject. Secondly, PAV relies on thesubject's chemoreceptor reflexes to monitor the composition of thearterial blood, and thereby set the level of spontaneous effort, The PAVdevice then amplifies this spontaneous effort. In subjects with abnormalchemoreceptor reflexes, the spontaneous efforts may either ceaseentirely, or become unrelated to the composition of the arterial blood,and amplification of these efforts will yield inadequate ventilation. Inpatients with existing Cheyne Stokes breathing during sleep, PAV will bydesign amplify the subject's waxing and waning breathing efforts, andactually make matters worse by exaggerating the disturbance. Thus PAVsubstantially meets goal (i) of providing assistance in phase with thesubject's spontaneous ventilation, but cannot meet goal (ii) ofadjusting the depth of assistance if the subject has inadequatechemoreflexes, and does not satisfactorily meet goal (iii).

Thus there are known devices that meet each of the above goals, butthere is no device hat meets all the goals simultaneously. Additionally,it is desirable to provide improvements over the prior art directed toany one of the stated goals.

Therefore, the present invention seeks to achieve, at least partially,one or more of the following:

(i) to match the phase and degree of assistance to the subject'sspontaneous efforts when ventilation is well above a target ventilation,

(ii) to automatically adjust the degree of assistance to maintain atleast a specified minimum average ventilation without relying on theintegrity of the subject's chemoreflexes and to damp out instabilitiesin the spontaneous ventilatory efforts, such as Cheyne Stokes breathing.

(iii) to provide some immunity to the effects of sudden leaks.

DISCLOSURE OF THE INVENTION

In what follows, a fuzzy membership function is taken as returning avalue between zero and unity, fit intersection A AND B is the smaller ofA and B, fuzzy union A OR B is the larger of A and B, and fuzzy negationNOT A is 1-A.

The invention discloses the determination of the instantaneous phase inthe respiratory cycle as a continuous variable.

The invention further discloses a method for calculating theinstantaneous phase in dew respiratory cycle including at least thesteps of determining that if the instantaneous airflow is small andincreasing fast, then it is close to start of inspiration, if theinstantaneous airflow is large and steady, then it is close tomid-inspiration, if the instantaneous airflow is small and decreasingfast, then it is close to mid-expiration, if the instantaneous airflowis zero and steady, then it is during an end-expiratory pause, andairflow conditions intermediate between the above are associated withcorrespondingly intermediate phases.

The invention further discloses a method for determining theinstantaneous phase in the respiratory cycle as a continuous variablefrom 0 to 1 revolution, the method comprising the steps of:

selecting at least two identifiable features F_(N) of a prototypeflow-vs-time waveform ƒ(t) similar to an expected respiratoryflow-vs-time waveform, and for each said feature:

determining by inspection the phase φ_(N) in the respiratory cycle forsaid feature, assigning a weight W_(N) to said phase,

defining a “magnitude” fuzzy set M_(N) whose membership function is afunction of respiratory airflow, and a “rate of change” fuzzy set C_(N),whose membership function is a function of the time derivative ofrespiratory airflow, chosen such that the fuzzy intersection M_(N) ANDC_(N) will be larger for points on the generalized prototype respiratorywaveform whose phase is closer to the said feature F_(N) than for pointscloser to all other selected features,

setting the fuzzy inference rule R_(N) for the selected feature F_(N) tobe: If flow is M_(N) and rate of change of flow is C_(N) thenphase=φ_(N), with weight W_(N),

measuring leak-corrected respiratory airflow,

for each feature F_(N) calculating fuzzy membership in fuzzy sets M_(N)and C_(N),

for each feature F_(N) applying fuzzy inference rule R_(N) to determinethe fuzzy extent Y_(N)=M_(N) AND C_(N) to which the phase is φ_(N), and

applying a defuzzification procedure using Y_(N) at phases φ_(N) andweights W_(N) to determine the instantaneous phase φ.

Preferably, the identifiable features include zero crossings, peaks,inflection points or plateaus of the prototype flow-vs-time waveform.Furthermore, said weights can be unity, or chosen to reflect theanticipated reliability of deduction of the particular feature.

The invention further discloses a method for calculating instantaneousphase in the respiratory cycle as a continuous variable, as describedabove, in which the step of calculating respiratory airflow includes alow pass filtering step to reduce non-respiratory noise, in which thetime constant of the low pass filter is an increasing function of anestimate of the length of the respiratory cycle.

The invention further discloses a method for measuring the instantaneousphase in the respiratory cycle as a continuous variable as describedabove, in which the defuzzification step includes a correction for anyphase delay introduced in the step of low pass filtering respiratoryairflow.

The invention further discloses a method for measuring the averagerespiratory rate, comprising the steps of:

measuring leak-corrected respiratory airflow,

from the respiratory airflow, calculating the instantaneous phase φ inthe respiratory cycle as a continuous variable from 0 to 1 revolution,calculating the instantaneous rate of change of phase dφ/dt, and

calculating the average respiratory rate by low pass filtering saidinstantaneous rate of change of phase dφ/dt.

Preferably, the instantaneous phase is calculated by the methodsdescribed above.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject, comprising the steps,performed at repeated sampling intervals, of:

ascribing a desired waveform template function Π(φ), with domain 0 to 1revolution and range 0 to 1,

calculating the instantaneous phase φ in the respiratory cycle as acontinuous variable from 0 to 1 revolution,

selecting a desired pressure modulation amplitude A,

calculating a desired instantaneous delivery pressure as an endexpiratory pressure plus the desired pressure modulation amplitude Amultiplied by the value of the waveform template function Π(φ) at thesaid calculated phase φ, and

setting delivered pressure to subject to the desired delivery pressure.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject as described above, inwhich the step of selecting a desired pressure modulation amplitude is afixed amplitude.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject as described above, inwhich the step of selecting a desired pressure modulation amplitude inwhich said amplitude is equal to an elastance multiplied by an estimateof the subject's tidal volume.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject as described above, inwhich the step of selecting a desired pressure modulation amplitudecomprises the substeps of:

specifying a typical respiratory rate giving a typical cycle time,

specifying a preset pressure modulation amplitude to apply at saidtypical respiratory rate,

calculating the observed respiratory rate giving an observed cycle time,and

calculating the desired amplitude of pressure modulation as said presetpressure modulation amplitude multiplied by said observed cycle timedivided by the said specified cycle time.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject, including at least thestep of determining the extent that the subject is adequatelyventilated, to said extent the phase in the respiratory cycle isdetermined from the subject's respiratory airflow, but to the extentthat the subject's ventilation is inadequate, the phase in therespiratory cycle is assumed to increase at a pre-set rate, and settingmask pressure as a function of said phase.

The invention further discloses a method for providing ventilatoryassistance in a spontaneously breathing subject, comprising the stepsof: measuring respiratory airflow, determining the extent to which theinstantaneous phase in the respiratory cycle can be determined from saidairflow, to said extent determining said phase from said airflow but tothe extent that the phase in the respiratory cycle cannot be accuratelydetermined, the phase is assumed to increase at a preset rate, anddelivering pressure as a function of said phase.

The invention further discloses a method for calculating theinstantaneous inspired volume of a subject, operable substantiallywithout run-away under conditions of suddenly changing leak, the methodcomprising the steps of:

determining respiratory airflow approximately corrected for leak,

calculating an index J varying from 0 to 1 equal to the fuzzy extent towhich said corrected respiratory airflow is large positive for longerthan expected, or large-negative for longer than expected,

identifying the start of inspiration, and

calculating the instantaneous inspired volume as the integral of saidcorrected respiratory airflow multiplied by the fuzzy negation of saidindex J with respect to time, from start of inspiration.

The invention further discloses a method “A” for providing ventilatoryassistance in a spontaneously breathing subject, the method comprisingthe steps, performed at repeated sampling intervals, of:

determining respiratory airflow approximately corrected for leak,

calculating an index J varying from 0 to 1 equal to the fuzzy extent towhich said respiratory airflow is large positive for longer thanexpected, or large negative for longer than expected,

calculating a modified airflow equal to said respiratory airflowmultiplied by the fuzzy negation of said index J.

identifying the phase in the respiratory cycle,

calculating the instantaneous inspired volume as the integral of saidmodified airflow with respect to time, with the integral held at zeroduring the expiratory portion of the respiratory cycle,

calculating a desired instantaneous delivery pressure as a function atleast of the said instantaneous inspired volume, and

setting delivered pressure to subject to the desired delivery pressure.

The invention further discloses a method “B” for providing ventilatoryassistance in a spontaneously breathing subject, comprising the stepsof:

determining respiratory airflow approximately corrected for leak,

calculating an index J varying from 0 to 1 equal to the fuzzy extent towhich the respiratory airflow is large positive for longer thanexpected, or large negative for longer than expected,

identifying the phase in the respiratory cycle,

calculating a modified respiratory airflow equal to the respiratoryairflow multiplied by the fuzzy negation of said index J,

calculating the instantaneous inspired volume as the integral of themodified airflow with respect to time, with the integral held at zeroduring the expiratory portion of the respiratory cycle,

calculating the desired instantaneous delivery pressure as an expiratorypressure plus a resistance multiplied by the instantaneous respiratoryairflow plus a nonlinear resistance multiplied by the respiratoryairflow multiplied by the absolute value of the respiratory airflow plusan elastance multiplied by the said adjusted instantaneous inspiredvolume, and

setting delivered pressure to subject to the desired delivery pressure.

The invention yet further discloses a method “C” for providing assistedventilation to match the subject's need, comprising the steps of:

describing a desired waveform template function Π(φ), with domain 0 to 1revolution and range 0 to 1,

determining respiratory airflow approximately corrected for leak,

calculating an index J varying from 0 to 1 equal to the fuzzy extent towhich the respiratory airflow is large positive for longer thanexpected, or large negative for longer than expected,

calculating J_(PEAK) equal to the recent peak of the index J,

calculating the instantaneous phase in the respiratory cycle,

calculating a desired amplitude of pressure modulation, chosen toservo-control the degree of ventilation to at least exceed a specifiedventilation,

calculating a desired delivery pressure as an end expiratory pressureplus the calculated pressure modulation amplitude A multiplied by thevalue of the waveform template function Π(φ) at the said calculatedphase φ, and

setting delivered pressure to subject to said desired instantaneousdelivered pressure,

The invention yet further discloses a method for providing assistedventilation to match the subject's need, as described above, in whichthe step of calculating a desired amplitude of pressure modulation,chosen to servo-control the degree of ventilation to at least exceed aspecified ventilation, comprises the steps of:

calculating a target airflow equal to twice the target ventilationdivided by the target respiratory rate,

deriving an error term equal to the absolute value of the instantaneouslow pass filtered respiratory airflow minus the target airflow, and

calculating the amplitude of pressure modulation as the integral of theerror term multiplied by a gain, with the integral clipped to liebetween zero and a maximum.

The invention yet further discloses a method for providing assistedventilation to match the subject's need, as described above, in whichthe step of calculating a desired amplitude of pressure modulation,chosen to servo-control the degree of ventilation to at least exceed aspecified ventilation, comprises the following steps:

calculating a target airflow equal to twice the target ventilationdivided by the target respiratory rate,

deriving an error term equal to the absolute value of the instantaneouslow pass filtered respiratory airflow minus the target airflow,

calculating an uncorrected amplitude of pressure modulation as theintegral of the error term multiplied by a gain, with the integralclipped to lie between zero and a maximum,

calculating the recent average of said amplitude as the low passfiltered amplitude, with a time constant of several times the length ofa respiratory cycle, and

setting the actual amplitude of pressure modulation to equal the saidlow pass filtered amplitude multiplied by the recent peak jamming indexJ_(PEAK) plus the uncorrected amplitude multiplied by the fuzzy negationof J_(PEAK).

The invention yet further discloses a method for providing assistedventilation to match the subject's need, and with particular applicationto subjects with varying respiratory mechanics, insufficient respiratorydrive, abnormal chemoreceptor reflexes, hypoventilation syndromes, orCheyne Stokes breathing, combined with the advantages of proportionalassist ventilation adjusted for sudden changes in leak, comprising thesteps, performed at repeated sampling intervals, of:

calculating the instantaneous mask pressure as described for methods “A”or “B” above,

calculating the instantaneous mask pressure as described for method “C”above,

calculating a weighted average of the above two pressures, and

setting the mask pressure to the said weighted average.

The invention yet further discloses apparatus to give effect to each oneof the methods defined, including one or more transducers to measureflow and/or pressure, processor means to perform calculations andprocedures, flow generators for the supply of breathable gas at apressure above atmospheric pressure and gas delivery means to deliverthe breathable gas to a subject's airways.

The apparatus can include ventilators, ventilatory assist devices, andCPAP devices including constant level, bi-level or autosetting leveldevices.

It is to be understood that while the algorithms embodying the inventionare explained in terms of fuzzy logic, approximations to thesealgorithms can be constructed without the use of the fuzzy logicformalism.

BRIEF DESCRIPTION OF THE DRAWINGS

A number of embodiments will now be described with reference to theaccompanying drawings in which:

FIGS. 1a and 1 b show apparatus for fir and second embodiments of theinvention respectively;

FIG. 2 is a pressure waveform function Π(Φ) used in the calculation ofthe desired instantaneous delivery pressure as a function of theinstantaneous phase Φ in the respiratory cycle for a first embodiment ofthe invention;

FIG. 3 shows fix membership functions for calculating the degree ofmembership in each of five magnitude fuzzy sets (“large negative”,“small negative”, “zero”, “small positive”, and “large positive”) fromthe normalized respiratory airflow according to the first embodiment ofthe invention; and

FIG. 4 shows membership functions for calculating the degree ofmembership in each of five rate of change fuzzy sets (“rising fast”,“rising slowly”, “steady”, “falling slowly”, and “falling fast”) fromthe normalized rate of change of airflow according to the firstembodiment of the invention;

FIG. 5 is a pressure waveform function Π(Φ) used in the calculation ofthe desired instantaneous delivery pressure as a function of theinstantaneous phase Φ in the respiratory cycle for a second embodimentof the invention;

FIG. 6 shows calculation of a quantity “lead-in” as a function of timesince the most recent mask off-on transition;

FIG. 7 shows a fuzzy membership function for fuzzy set A_(I) as afunction of time since the most recent expiratory-to-inspiratory(negative-to-positive) zero crossing of the respiratory airflow signal,such that the membership function measures the extent to which therespiratory airflow has been positive for longer than expected;

FIG. 8 shows a membership function for fuzzy set B_(I) as a function ofrespiratory airflow, such that the membership function measures theextent to which respiratory airflow is large positive;

FIG. 9 shows an electrical analog of the calculation of a recent peakjamming index J_(PEAK) from the instantaneous jamming index J;

FIG. 10 shows the calculation of the time constant τ used in low passfiltering steps in the calculation of the conductance of a leak, as afunction of the recent peak jamming index J_(PEAK).

FIG. 11 shows a prototypical respiratory flow-time curve, with time onthe x-axis, marking nine features;

FIG. 12 shows membership functions for fuzzy sets “large negative”,“small negative”, “zero”, “small positive”, and “large positive” asfunctions of normalized respiratory airflow according to a secondembodiment of the invention;

FIG. 13 shows membership functions for fuzzy sets “falling”, “steady”,and “rising” as functions of normalized rate of change of respiratoryairflow df/dt according to a second embodiment of the invention;

FIG. 14 shows the membership function for fuzzy set “hypopnea”;

FIG. 15 shows the calculation of the time constant τ for calculation ofnormalized recent ventilation, as a function of “servo gain” being thegain used for servo-control of minute ventilation to at least exceed aspecified target ventilation;

FIG. 16 shows the membership function for fuzzy set “hyperpnea”as afunction of normalized recent ventilation;

FIG. 17 shows the membership function for fuzzy set “big leak” as afunction of leak;

FIG. 18 shows the membership functions for fuzzy sets “switch negative”and “switch positive” as a function of nomalized respiratory airflow;

FIG. 19 shows the membership functions for fuzzy sets “insp_phase” and“exp_phase” as functions of the instantaneous phase in the respiratorycycle φ;

FIG. 20 shows schematically how function W(y), used in defuzzification,calculates the area (shaded) of an isosceles triangle of unit base andheight cut off below height y;

FIGS. 21-26 show actual 60 second flow and pressure tracings from thesecond embodiment of the invention during operation; the vertical scalefor flow (heavy trace) is ±1 L/sec, inspiration upwards and the verticalscale for the pressure (light trace) is 0-25 cmH₂O; where:

FIG. 21 shows that a short central apnea (b) is permitted when effortceases at point (c) after a preceding deep breath (a);

FIG. 22 shows that a central apnea is not permitted when effort ceasesat arrow (a) without a preceeding deep breath;

FIG. 23 is recorded with servo gain set high, and shows that a centralapnea is no longer permitted when effort ceases at arrow (a) despitepreceding deep breathing;

FIG. 24 shows automatically increasing end-inspiratory pressure as thesubject makes voluntarily deeper inspiratory efforts;

FIG. 25 is recorded with a somewhat more square waveform selected, andshows automatically increasing pressure support when the subjectvoluntarily attempts to resist by stiffening the chest wall at point(a);

FIG. 26 shows that with sudden onset of a sever 1.4 L/sec leak at (a),the flow signal returns to baseline (b) within the span of a singlebreath, and pressure continues to cycle correctly throughout; and

FIG. 27 shows an actual 60 second tracing showing respiratory airflow(heavy trace, ±1 L/sec full scale) and instantaneous phase (light trace,0-1 revolution full scale).

DESCRIPTION OF PREFERRED EMBODIMENTS

The two embodiments to be described are ventilators that operate in amanner that seeks to simultaneously achieve the three goals slatedabove.

First Embodiment

Apparatus to give effect to a first embodiment of the apparatus is shownin FIG. 1a. A blower 10 supplies a breathable gas to mask 11 incommunication with the subject's airway via a delivery tube 12 andexhausted via a exhaust diffuser 13. Airflow to the mask 11 is measuredusing a pneumotachograph 14 and a differential pressure transducer 15.The mask flow signal from the transducer 15 is then sampled by amicroprocessor 16. Mask pressure is measured at the port 17 using apressure transducer 18. The pressure signal from the transducer 18 isthen sampled by the microprocessor 16. The microprocessor 16 sends aninstantaneous mask pressure request signal to the servo 19, whichcompares said pressure request signal with actual pressure signal fromthe transducer 18 to the control fan motor 20. The microprocessorsettings can be adjusted via a serial port 21.

It is to be understood that the mask could equally be replaced with atracheotomy tube, endotracheal tube, nasal pillows, or other means ofmaking a sealed connection between the air delivery means and thesubject's airway.

The microprocessor 16 is programmed to perform the following steps, tobe considered in conjunction with Tables 1 and 2.

TABLE 1 Fuzzy Inference Rules for a first embodiment N FuzzyInterference Rule Fuzzy Phase 1 if size is Zero and rate of Increasingthen phase is Start Inspiration 2 if size is Small and rate ofIncreasing then phase is Early Inspiration Positive change is Slowly 3if size is Large and rate of Steady then phase is Peak InspirationPositive change is 4 if size is Small and rate of Decreasing then phaseis Late Inspiration Positive change is Slowly 5 if size is Zero and rateof Decreasing then phase is Start Expiration change is Fast 6 if size isSmall and rate of Decreasing then phase is Early Expiration Negativecharge is Slowly 7 if size is Large and rate of Steady then phase isPeak Expiration Negative change is 8 if size is Small and rate ofIncreasing then phase is Late Expiration Negative change is Slowly 9 ifsize is Zero and rate of Steady then phase is Expiratory Pause change is10 always phase is Unchanged

TABLE 2 Association of phases with fuzzy rules for a first embodiment. NPhase Φ_(N) 1 Start Inspiration 0.0 2 Early Inspiration values 3 PeakInspiration intermediate between 4 Late Inspiration 0.0 and 0.5 5 StartExpiration 0.50 6 Early Expiration values 7 Peak Expiration intermediatebetween 8 Late Expiration 0.5 and 1.0 9 Expiratory Pause 10  Unchanged Φ

1. Set desired target values for the duration of inspiration TI_(TGT),duration of expiration TE_(TGT), and minute ventilation V_(TGT). Choosesuitable constants P₀ and A_(STD) where P₀ is the desired end expiratorypressure, and A_(STD) is the desired crease in pressure above P₀ at endinspiration for a breath of duration TT_(TGT)=TI_(TGT)+TE_(TGT).

2. Choose a suitable pressure waveform function Π(Φ), such as that shownin FIG. 2, such that the desired delivery pressure at phase Φ will begiven by:

P=P ₀ +AΠ(Φ)

where the amplitude A equals the difference between the end inspiratorypressure and end expiratory pressure. However, other waveforms may besuitable for subjects with particular needs.

3. Initialize the phase Φ in the respiratory cycle to zero, andinitialize the current estimates of actual inspiratory and expiratoryduration TI and TE to TI_(TGT) and TE_(TGT) respectively.

4. Initialize the rate of change of phase during inspiration ΔΦ_(I)between sampling intervals of length T to:

ΔΦ+=0.5 T/TI _(TGT)

5. Initialize the rate of change of phase during expiration ΔΦ_(E) to:

ΔΦ_(E)=0.5 T/TE _(TGT)

6. Measure the instantaneous respiratory airflow f_(RESP).

7. Calculate the average total breath duration TT=TI+TE

8. Low pass filter the respiratory airflow with an adjustable timeconstant τf, where τf is a fixed small fraction of TT.

9. Calculate the instantaneous ventilation V, as half the absolute valueof the respiratory airflow:

V=0.5|f _(RESP)|

10. From the target ventilation V_(TGT) and the measured minuteventilation V, derive an error term V_(ERR), such that large values ofV_(ERR) indicate inadequate ventilation:

V _(ERR)=∫(V _(TGT) −V)dt

11. Take V_(BAR) as the result of low pass filtering V with a timeconstant τV_(BAR) which is long compared with TT.

12. Calculate a normalized airflow f_(NORM), where

f _(NORM) =f _(RESP) /V _(BAR).

13. From f_(NORM), calculate the degree of membership in each of thefuzzy sets whose membership functions are shown in FIG. 3.

14. Calculate a normalized rate of change df_(NORM)/dΦ, equal todf_(NORM)/dt divided by the current estimate of the average respiratorycycle time TT.

15. From the normalized rate of change, calculate the degree ofmembership in each of the fuzzy sets shown in FIG. 4.

16. For each row N in Table 1, calculate the degree of membership g_(N)in the set shown in the column labelled Fuzzy Phase, by applying thefuzzy inference rules shown.

17. Associate with the result of each of the N rules a phase Φ_(N) asshown in Table 2, noting that Φ₁₀ is the current phase Φ.

18. Increase each of the Φ_(N) excepting Φ₁₀ by 0.89 τ/TT, to compensatefor the previous low pass filtering step.

19. Calculate a new instantaneous phase Φ_(INST) as the angle to thecenter of gravity of N unit masses at polar coordinates of radius g_(N)and angle Φ_(N) revolutions.

20. Calculate the smallest signed difference ΔΦ_(INST) between the phaseestimated in the previous step and the current phase.

ΔΦ_(INST)=1−(ΔΦ_(INST)−Φ)(Φ_(INST)−Φ>0.5)

ΔΦ_(INST)=Φ_(INST)−Φ+1)(Φ_(INST)−Φ<−0.5)

ΔΦINST=Φ_(INST)−Φ)(otherwise)

21. Derive a revised estimate ΔΦ_(REV) equal to a weighted mean of thevalue calculated in the previous step and the average value (ΔΦ_(I) orΔΦ_(E) as appropriate).

ΔΦ=(1−W)ΔΦ _(I) +WΔΦ _(INST)(0<Φ<0.5)

ΔΦ=(1−W)ΔΦ _(I) +WΔΦ _(INST)(otherwise)

Smaller values of W will cause better tracking of phase if the subjectis breathing regularly, and larger values will cause better tracking ofphase if he subject is breathing irregularly.

22. Derive a blending fraction B, such that the blending fraction isunity if the subject's ventilation is well above V_(TGT), zero if thesubject is breathing near or below V_(TGT), and increasingproportionally from zero to unity as the subject's ventilation increasesthrough an intermediate range.

23. Calculate ΔΦ_(BLEND) influenced chiefly by ΔΦ calculated in step 21from the subject's respiratory activity if the subject's ventilation iswell above V_(TGT); influenced chiefly by the target respiratoryduration if the subject is breathing near or below V_(TGT); andproportionally between these two amounts if ventilation is in anintermediate range:

ΔΦ_(BLEND) =B ΔΦ+0.5(1−B)T/TI _(TGT)(0<Φ<0.5)

ΔΦ_(BLEND) =B ΔΦ+0.5(1−B)T/TE _(TGT)(otherwise)

24. Increment Φ by ΔΦ_(BLEND)

25. Update the average rate of change of phase (ΔΦ_(I) or ΔΦ_(E) asappropriate).

ΔΦ_(I) =T/τ _(VBAR)(ΔΦ_(BLEND)−ΔΦ_(I))(0<Φ<0.5)

ΔΦ_(E) =T/τ _(VBAR)(ΔΦ_(BLEND)−ΔΦ_(E))(otherwise)

26. Recalculate the approximate duration of inspiration TI andexpiration TE:

TI=0.5 T/ΔΦ _(I)

TE=0.5 T/ΔΦ _(E)

27. Calculate the desired mask pressure modulation amplitude A_(D):

A _(D) =A _(STD)/2(TT<TT _(STD)/2)

A _(D)=2·A _(STD)(TT>2·TT _(STD))

A _(D) =A _(STD) ·TT/TT _(STD))(otherwise)

28. From the error term V_(ERR), calculate an additional mask pressuremodulation amplitude A_(E):

A _(E) =K·V _(ERR)(for V _(ERR)>0)

A _(E)=0(otherwise)

where larger values of K will produce a faster but less stable controlof the degree of assistance, and smaller values of K will produce slowerbut more stable control of the degree of assistance.

29. Set the mask pressure P_(MASK) to:

P _(MASK) =P ₀+(A _(D) +A _(E)) Π(Φ)

30. Wait for a sampling interval T, short compared with the duration ofa respiratory cycle, and then continue at the step of measuringrespiratory airflow.

Measurement of Respiratory Airflow

As follows from above, it is necessary to respiratory airflow, which isa standard procedure to one skilled in the art. In the absence of leak,respiratory airflow can be measured directly with a pneumotachographplaced between the mask and the exhaust. In the presence of a possibleleak, one method disclosed in European Publication No 0 651 971incorporated herein by cross-reference is to calculate the mean flowthrough the leak, and thence calculate the amount of modulation of thepneumotachograph flow signal due to modulation of the flow through theleak induced by changing mask pressure, using the following steps:

1. Measure the airflow at the mask f_(MASK) using a pneumotachograph

2. Measure the pressure at the mask P_(MASK)

3. Calculate the mean leak as the low pass filtered airflow, with a timeconstant long compared with a breath.

4. Calculate the mean mask pressure as the low pass filtered maskpressure, with a time constant long compared with a breath.

5. Calculate the modulation of the flow through the leak as:

δ(leak)=0.5 times the mean leak times the inducing pressure,

where the inducing pressure is P_(MASK)−mean mask pressure.

Thence the instantaneous respiratory airflow can be calculated as,

f _(RESP) =f _(MASK)−mean leak−δ(leak)

A convenient extension as further disclosed in EP 0 651 971(incorporated herein by cross-reference) is to measure airflowf_(TURBINE) and pressure P_(TURBINE) at the outlet of the turbine, andthence calculate P_(MASK) and f_(MASK) by allowing for the pressure dropdown the air delivery hose, and the airflow lost via the exhaust:

1. ΔP_(HOS)E=K₁(F_(TURBINE))−K₂(F_(TURBINE))²

2. P_(MASK)=P_(TURBINE)−ΔP_(HOSE)

3. F_(EXHAUST)=K3 P _(MASK)

4. F_(MASK)=F_(TURBINE)−F_(EXHAUST.)

Alternative Embodiment

The following embodiment is particularly applicable to subjects withvarying respiratory mechanics, insufficient respiratory drive, abnormalchemoreceptor reflexes, hypoventilation syndromes, or Cheyne Stokesbreathing, or to subjects with abnormalities of the upper or lowerairways, lungs, chest wall, or neuromuscular system.

Many patients with severe lung disease cannot easily be treated using asmooth physiological pressure waveform, because the peak pressurerequired is unacceptably high, or unachievable with for example anose-mask. Such patients may prefer a square pressure waveform, in whichpressure rises explosively fast at the moment of commencement ofinspiratory effort. This may be particularly important in patients withhigh intrinsic PEEP, in which it is not practicable to overcome theintrinsic PEEP by the use of high levels of extrinsic PEEP or CPAP, dueto the risk of hyperinflation. In such subjects, any delay in triggeringis perceived as very distressing, because of the enormous mis-matchbetween expected and observed support. Smooth waveforms exaggerate theperceived delay, because of the time taken for the administered pressureto exceed the intrinsic PEEP. This embodiment permits the use ofwaveforms varying continuously from square (suitable for patients withfor example severe lung or chest wall disease or high intrinsic PEEP) tovery smooth, suitable for patients with normal lungs and chest wall, butabnormal respiratory control, or neuromuscular abnormalities. Thiswaveform is combined either with or without elements of proportionassist ventilation (corrected for sudden changes in leak), withservo-control of the minute ventilation to equal or exceed a targetventilation. The latter servo-control has an adjustable gains so thatsubjects with for example Cheyne Stokes breathing can be treated using avery high servo gain to over-ride their own waxing and waning patterns;subjects with various central hypoventilation syndromes can be treatedwith a low servo gain, so that short central apneas are permitted, forexample to cough, clear the throat, talk, or roll over in bed, but onlyif they follow a previous period of high ventilation; and normalsubjects are treated with an intermediate gain.

Restating the above in other words:

The integral gain of the servo-control of the degree of assistance isadjustable from very fast (0.3 cmH₂O/L/sec/sec) to very slow. Patientswith Cheyne-Stokes breathing have a very high ventilatory control loopgain, but a long control loop delay, leading to hunting. By setting theloop gain even higher, the patient's controller is stabilized. Thisprevents the extreme breathlessness that normally occurs during eachcycle of Cheyne-Stokes breathing, and this is very reassuring to thepatient. It is impossible for them to have a central apnea. Conversely,subjects with obesity-hypoventilation syndrome have low or zero loopgain. They will not feel breathless during a central apnea. However,they have much mucus and need to cough, and are also often very fidgety,needing to roll about in bed. This requires that they have centralapneas which the machine does not attempt to treat. By setting the loopgain very low, the patient is permitted to take a couple of deep breathsand then have a moderate-length central apnea while coughing, rollingover, etc, but prolonged sustained apneas or hypopneas are prevented.

Sudden changes in leakage flow are detected and handled using a fixlogic algorithm. The principle of the algorithm is that the leak filtertime constant is reduced dynamically to the fuzzy extent that theapparent respiratory airflow is a long way from zero for a long timecompared with the patient's expected respiratory cycle length.

Rather than simply triggering between two states (IPAP, EPAP), thedevice uses a fuzzy logic algorithm to estimate the position in therespiratory cycle as a continuous variable. The algorithm permits thesmooth pressure waveform to adjust it's rise time automatically to thepatient's instantaneous respiratory pattern.

The fuzzy phase detection algorithm under normal conditions closelytacks the patient's breathing. To the extent that there is a high orsuddenly changing leak, or the patient's ventilation is low, the rate ofchange of phase (respiratory rate) smoothly reverts to the specifiedtarget respiratory rate. Longer or deeper hypopneas are permitted to theextent that ventilation is on average adequate. To the extent that theservo gain is set high to prevent Cheyne Stokes breathing, shorter andshallower pauses are permitted.

Airflow filtering uses an adaptive filter, which shortens it's timeconstant if the subject is breathing rapidly, to give very fast responsetimes, and lenthens if the subject is breathing slowly, to helpeliminate cardiogenic artifact.

The fuzzy changing leak detection algorithm, the fuzzy phase detectionalgorithm with its differential handling of brief expiratory pauses, andhandling of changing leak, together with the smooth waveform severallyand cooperatively make the system relatively immune to the effects ofsudden leaks.

By suitably setting various parameters, the system can operate in CPAP,bilevel spontaneous, bilevel timed, proportional assist ventilation,volume cycled ventilation, and volume cycled servo-ventilation, andtherefore all these modes are subsets of the present embodiment. Howeverthe present embodiment permits states of operation that can not beachieved by any of the above states, and is therefore distinct fromthem.

Notes

Note 1: in this second embodiment, the names and symbols used forvarious quantities may be different to those used in the firstembodiment.

Note 2: The term “swing” is used to refer to the difference betweendesired instantaneous pressure at end inspiration and the desiredinstantaneous pressure at end expiration.

Note 3: A fuzzy membership function is taken as returning a valuebetween zero for complete nonmembership and unity for completemembership. Fuzzy intersection A AND B is the lesser of A and B, fuzzyunion A OR B is the larger of A and B, and fuzzy negation NOT A is 1−A.

Note 4: root(x) is the square root of x, abs(x) is the absolute value ofx, sign(x) is −1 if x is negative, and +1 otherwise. An asterisk (*) isused to explicitly indicate multiplication where this might not beobvious from context.

Apparatus

The apparatus for the second embodiment is shown in FIG. 1b. The blower110 delivers air under pressure to the mask 111 via the air deliveryhose 112. Exhaled 25 air is exhausted via the exhaust 113 in the mask111. The pneumotachograph 114 and a differential pressure transducer 115measure the airflow in the nose 112. The flow signal is delivered to themicroprocessor 116. Pressure at any convenient point 117 along the nose112 is measured using a pressure transducer 118. The output from thepressure transducer 118 is delivered to the microcontroller 116 and alsoto a motor servo 119. The microprocessor 116 supplies the motor servo119 with a pressure request signal, which is then compared with thesignal from the pressure transducer 118 to control the blower motor 120.User configurable parameters are loaded into the microprocessor 116 viaa communications port 121, and the computed mask pressure and flow canif desired be output via the communications port 121.

Initialization

The following user adjustable parameters are specified and stored:

max permissible pressure maximum permissible mask pressure max swingmaximum permissible difference between end inspiratory pressure and endexpiratory pressure. min swing minimum permissible difference betweenend inspiratory pressure and end expiratory pressure. epap endexpirarory pressure min permissible pressure minimum permissible maskpressure target ventilation minute ventilation is sevo-controlled toequal or exceed this quantity target frequency Expected respiratoryrate. If the patient is achieving no respiratory airflow, the pressurewill cycle at this frequency. target duty cycle Expected ratio ofinspiratory time to cycle time. If the patient is achieving norespiratory airflow, the pressure will follow this duty cycle. linearresistance and resistive unloading = linear resistance * f + quadresistance quad_resistance * f² sign(f), where f is the respiratoryairflow where sign(x) = −1 for x < 0, +1 otherwise elastance Unload atleast this much elastance servo gain gain for servo-control of minuteventilation to at least exceed target ventilation. waveform timeconstant Elastic unloading waveform time constant as a fraction ofinspiratory duration. (0.0 = square wave) hose resistance ΔP frompressure sensing port to inside mask = hose resistance times the squareof the flow in the intervening tubing. diffuser conductance Flow throughthe mask exhaust port = diffuser conductance * root mask pressure

At initialization, the following are calculated from the aboveuser-specified settings:

The expected duration of a respiratory cycle, of an inspiration, and ofan expiration are set respectively to:

SDT T _(TOT)=60/target respiratory rate

SDT T _(I) =STD T _(TOT)*target duty cycle

STD T _(E) =STD T _(TOT) −SDT T _(I)

The standard rates of change of phase (revolutions per sec) duringinspiration and expiration are set respectively to:

STD dφ₁=0.5/STD T ₁

STD dφ_(E)=0.5/STD T _(E)

The instantaneous elastic support at any phase φ in the respiratorycycle is given by:

PEL(φ)=swing*Π(φ)

where swing is the pressure at end inspiration minus the pressure at endexpiration,

Π(φ)=e ⁻²τφ during inspiration,

e ⁻⁴τ(φ−0.5) during expiration

and τ is the user-selectable waveform time constant.

If τ=0, then Π(φ) is a square wave. The maximum implemented value forτ=0.3, producing a waveform approximately as shown in FIG. 5.

The mean value of Π(φ) is calculated as follows:$\prod\limits_{BAR}{= {0.5{\int_{0}^{.05}{\prod{(\varphi)\quad {\varphi}}}}}}$

Operations Performed Every 20 Milliseconds

The following is an overview of routine processing done at 50 Hz:

measure flow at flow sensor and pressure at pressure sensing port

calculate mask pressure and flow from sensor pressure and flow

calculate conductance of mask leak

calculate instantaneous airflow through leak

calculate respiratory airflow and low pass filtered respiratory airflow

calculate mask on-off status and lead-in

calculate instantaneous and recent peak jamming

calculate time constant for leak conductance calculations

calculate phase in respiratory cycle

update mean rates of change of phase for inspiration and expiration,lengths of inspiratory and expiratory times, and respiratory rate

add hose pressure loss to EPAP pressure

add resistive unloading

calculate instantaneous elastic assistance required to servo-controlventilation

estimate instantaneous elastic recoil pressure using various assumptions

weight and combine estimates

add servo pressure to yield desired sensor pressure

servo-control motor speed to achieve desired sensor pressure

The details of each step will now be explained.

Measurement of Flow and Pressure

Flow is measured at the outlet of the blower using a pneumotachographand differential pressure transducer. Pressure is measured at anyconvenient point between the blower outlet and the mask. A humidifierand/or anti-bacterial filter may be inserted between the pressuresensing port and the blower. Flow and pressure are digitized at 50 Hzusing an A/D converter.

Calculation of Mask Flow and Pressure

The pressure loss from pressure measuring point to mask is calculatedfrom the flow at the blower and the (quadratic) resistance frommeasuring point to mask.

Hose pressure loss=sign(flow)*hose resistance*flow²

where sign(x)=−1 for x<0, +1 otherwise. The mask pressure is thencalculated by subtracting the hose pressure loss from the measuredsensor pressure:

Mask pressure=sensor pressure−hose pressure loss

The flow through the mask exhaust diffuser is calculated from the knownparabolic resistance of the diffuser holes, and the square root of themask pressure:

diffuser flow=exhaust resistance*sign(mask pressure)*root(abs(maskpressure))

Finally, the mask flow is calculated:

mask flow=sensor flow−diffuser flow

The foregoing describes calculation of mask pressure and flow in thevarious treatment modes. In diagnostic mode, the patient is wearing onlynasal cannulae, not a mask. The cannula is plugged into the pressuresensing port. The nasal airflow is calculated from the pressure, after alinearization step, and the mask pressure is set to zero by definition.

Conductance of Leak

The conductance of the leak is calculated as follows:

root mask pressure=sign (P _(MASK)) {square root over (abs (P_(MASK)))}

LP mask airflow=low pass filtered mask airflow

LP root mask pressure=low pass filtered root mask pressure

conductance of leak=LP mask airflow/LP root mask pressure

The time constant for the two low pass filtering steps is initialized to10 seconds and adjusted dynamically thereafter (see below).

Instantaneous Flow Through Leak

The instantaneous flow through the leak is calculated from theinstantaneous mask pressure and the conductance of the leak:

instantaneous leak=conductance of leak*root mask pressure

Respiratory Airflow

The respiratory airflow is the difference between the flow at the maskand the instantaneous leak;

respiratory airflow=mask flow−instantaneous leak

Low Pass Filtered Respiratory Airflow

Low pass filter the respiratory airflow to remove cardiogenic airflowand other noise. The time constant is dynamically adjusted to be{fraction (1/40)} of the current estimated length of the respiratorycycle T_(TOT) (initialized to STD_T_(TOT) and updated below). This meansthat at high respiratory rates, there is only a short phase delayintroduced by the filter, but at low respiratory rates, there is goodrejection of cardiogenic airflow.

Mask on/off Status

The mask is assumed to initially be off. An off-on transition is takenas occurring when the respiratory airflow first goes above 0.2 L/sec,and an on-off transition is taken as occurring if the mask pressure isless than 2 cmH₂O for more than 1.5 seconds.

Lead-in

Lead-in is a quantity that runs from zero if the mask is off, or hasjust been donned, to 1.0 if the mask has been on for 20 seconds or more,as shown in FIG. 6.

Calculation of Instantaneous Jamming Index, J

J is the fuzzy extent to which the impedance of the leak has suddenlychanged. It is calculated as the fuzzy extent to which the absolutemagnitude of the respiratory airflow is large for longer than expected.

The fuzzy extent A_(I) to which the airflow has been positive for longerthan expected is calculated from the time t_(ZI) since the lastpositive-going zero crossing of the calculated respiratory airflowsignal, and the expected duration STD T_(I) of a normal inspiration forthe particular subject, using the fuzzy membership function shown inFIG. 7.

The fuzzy extent B_(I) to which the airflow is large and positive iscalculated from the instantaneous respiratory airflow using the fuzzymembership function shown in FIG. 8.

The fuzzy extent I_(I) to which the leak has suddenly increased iscalculated by calculating the fuzzy intersection (lesser) of A_(I) andB_(I).

Precisely symmetrical calculations arc performed for expiration,deriving I_(E) as the fuzzy extent to which the leak has suddenlydecreased. A_(E) is calculated from T_(ZE) and T_(E), B_(E) iscalculated from minus f_(RESP), and I_(E) is the fuzzy intersection ofA_(E) and B_(E). The instantaneous jamming index J is calculated as thefuzzy union (larger) of indices I_(I) and I_(E).

Recent Peak Jamming

If the instantaneous jamming index is larger than the current value ofthe recent peak jamming index, then the recent peak jamming index is setto equal the instantaneous jamming index. Otherwise, the recent peakjamming index is set to equal the instantaneous jamming index low passfiltered with a time constant of 10 seconds. An electrical analogy ofthe calculation is shown in FIG. 9.

Time Constant for Leak Conductance Calculations

If the conductance of the leak suddenly changes, then the calculatedconductance will initially be incorrect, and will gradually approach thecorrect value at a rate which will be slow if the time constant of thelow pass filters is long, and fast if the time constant is short.Conversely, if the impedance of the leak is steady, the longer the timeconstant the more accurate the calculation of the instantaneous leak.Therefore, it is desirable to lengthen the time constant to the extentthat the leak is steady, reduce the time constant to the extent that theleak has suddenly changed, and to use intermediately longer or shortertime constants if it is intermediately the case that the leak is steady.

If there is a large and sudden increase in the conductance of the leak,then the calculated respiratory airflow will be incorrect. Inparticular, during apparent inspiration, the calculated respiratoryairflow will be large positive for a time that is large compared withthe expected duration of a normal inspiration. Conversely, if there is asudden decrease in conductance of the leak, then during apparentexpiration the calculated respiratory airflow will be large negative fora time that is large compared with the duration of normal expiration.

Therefore, the time constant for the calculation of the conductance ofthe leak is adjusted depending on J_(PEAK), which is a measure of thefuzzy extent that the leak has recently suddenly changed, as shown inFIG. 10.

In operation, to the extent that there has recently been a sudden andlarge change in the leak, J_(PEAK) will be large, and the time constantfor the calculation of the conductance of the leak will be small,allowing rapid convergence on the new value of the leakage conductance.Conversely, if the leak is steady for a long time, J_(PEAK) will besmall, and the time constant for calculation of the leakage conductancewill be large, enabling accurate calculation of the instantaneousrespiratory airflow. In the spectrum of intermediate situations, wherethe calculated instantaneous respiratory airflow is larger and forlonger periods, J_(PEAK) will be progressively larger, and the timeconstant for the calculation of the leak will progressively reduce. Forexample, at a moment in time where it is uncertain whether the leak isin fact constant, and the subject has merely commenced a large sigh, orwhether in fact there has been a sudden increase in the leak, the indexwill be of an intermediate value, and the time constant for calculationof the impedance of the leak will also be of an intermediate value. Theadvantage is that some corrective action will occur very early, butwithout momentary total loss of knowledge of the impedance of the leak.

Instantaneous Phase in Respiratory Cycle

The current phase φ runs from 0 for start of inspiration to 0.5 forstart of expiration to 1.0 for end expiration=start of next inspiration.Nine separate features (peaks, zero crossings, plateaux, and someintermediate points) are identified on the waveform, as shown in FIG.11.

Calculation of Normalized Respiratory Airflow

The filtered respiratory airflow is normalized with respect to the userspecified target ventilation as follows:

standard airflow=target ventilation/7.5 L/min

ƒ′=filtered respiratory airflow/standard airflow

Next, the fuzzy membership in fuzzy sets large negative, small negative,zero, small positive, and large positive, describing the instantaneousairflow is calculated using the membership functions shown in FIG. 12.For example, if the normalized airflow is 0.25, then the airflow islarge negative to extent 0.0, small negative to extent 0.0, zero toextent 0.5, small positive to extent 0.5, large positive to extent 0.00.

Calculation of Normalized Rate of Change of Airflow

The rate of change of filtered respiratory airflow is calculated andnormalized to a target ventilation of 7.5 L/min at 15 breaths/min asfollows:

standard dƒ/dt=standard airflow*target frequency/15

calculate d (filtered airflow)/dt

low pass filter with a time constant of 8/50 seconds

normalize by dividing by standard df/dt

Now evaluate the membership of normalized df/dt in the fuzzy setsfalling, steady, and rising, whose membership functions are shown inFIG. 13.

Calculation of ventilation, normalized ventilation, and hypopnea

ventilation=abs(respiratory airflow), low pass filtered with a timeconstant of STD T _(TOT).

normalized ventilation=ventilation/standard airflow

Hypopnea is the fuzzy extent to which the normalized ventilation iszero. The membership function for hypopnea is shown in FIG. 14.

Calculation of Recent Ventilation, Normalized Recent Ventilation, andHyperpnea

Recent ventilation is also a low pass filtered abs(respiratory airflow),but filtered with an adjustable time constant, calculated from servogain (specified by the user) as shown in FIG. 15. For example, if theservo gain is set to the maximum value of 0.3, the time constant iszero, and recent ventilation equals instantaneous abs(respiratoryairflow). Conversely, if servo gain is zero, the time constant is twiceSTD T_(TOT), the expected length of a typical breath.

Target absolute airflow=2*target ventilation

normalized recent ventilation=recent ventilation/target absolute airflow

Hyperpnea is the fuzzy extent to which the recent ventilation is large.The membership function for hyperpnea is shown in FIG. 16.

Big Leak

The fuzzy extent to which there is a big leak is calculated from themembership function shown in FIG. 17.

Additionally Fuzzy Sets Concerned with Fuzzy “Triggering”

Membership in fuzzy sets switch negative and switch positive arecalculated from the normalized respiratory airflow using the membershipfunctions shown in FIG. 18, and membership in fuzzy sets insp_phase andexp_phase are calculated from the current phase f using the membershipfunction shown in FIG. 19.

Fuzzy Inference Rules for Phase

Procedure W(y) calculates the area of an isosceles triangle of unitheight and unit base, truncated at height y as shown in FIG. 20. In thecalculations that follow, recall that fuzzy intersection a AND b is thesmaller of a and b, fuzzy union a OR b is the larger of a and b, andfuzzy negation NOT a is 1−a.

The first fuzzy rule indicates that lacking any other information thephase is to increase at a standard rate. This rule is unconditionallytrue, and has a very heavy weighting, especially if there is a largeleak, or there has recently been a sudden change in the leak, or thereis a hypopnea.

W _(STANDARD)=8+16*J _(PEAK)+16*hyopopnea+16*big leak

The next batch of fuzzy rules correspond to the detection of variousfeatures of a typical flow-vs-time curve. These rules all have unitweighting, and are conditional upon the fuzzy membership in theindicated sets:

W _(EARLY INSP) =W(rise and small positive)

W _(PEAK INSP) =W(large positive AND steady AND NOT recent peak jamming)

W _(LATE INSP) =W(fall AND small positive)

W _(EARLY EXP) =W(fall AND small negative)

W _(PEAK EXP) =W(large negative AND steady)

W _(LATE EXP) =W(rise AND small negative)

The next rule indicates that there is a legitimate expiratory pause (asopposed to an apnea) if there has been a recent hyperpnea and the leakhas not recently changed:

W _(PAUSE)=(hyperpnea AND NOT J _(PEAK))*W(steady AND zero)

Recalling that the time constant for hyperpnea gets shorter as servogain increases, the permitted length of expiratory pause gets shorterand shorter as the servo gain increases, and becomes zero at maximumservo gain. The rationale for this is that (i) high servo gain plus longpauses in breathing will result in “hunting” of the servo-controller,and (ii) in general high servo gain is used if the subject'schemoreceptor responses are very brisk, and suppression of long apneasor hypopneas will help prevent the subject's own internal servo-controlfrom hunting, thereby helping prevent Cheyne-Stokes breathing.

Finally, there are two phase-switching rules. During regular quietbreathing at roughly the expected rate, these rules should not stronglyactivate, but they are there to handle irregular breathing or breathingat unusual rates. They have very heavy weightings.

W _(TRIG INSP)=32 W(expiratory phase AND switch positive)

W _(TRIG EXP)=32 W(inspiratory phase AND switch negative)

Defuzzification

For each of the ten fuzzy rules above, we attach phase angles fN, asshown in Table ZZZ. Note that φN are in revolutions, not radians. We nowplace the ten masses W(N) calculated above at the appropriate phaseangles φ_(N) around the unit circle, a take the centroid.

Rule N φ_(N) STANDARD 1 current φ TRIG INSP 2 0.00 EARLY INSP 3 0.10PEAK INSP 4 0.30 LATE INSP 5 0.50 TRIG EXP 6 0.5 + 0.05 k EARLY EXP 70.5 + 0.10 k PEAK EXP 8 0.5 + 0.20 k LATE EXP 9 0.5 + 0.4 k  EXP PAUSE10  0.5 + 0.5 k 

where k=STD T_(I)/STD T_(E).

Note that if the user has entered very short duty cycle, k will besmall. For example a normal duty cycle is 40%, giving k=40/60=0.67. Thusthe expiratory peak will be associated with a phase angle of0.5+0.2*0.67=0.63, corresponding 26% of the way into expiratory time,and the expiratory pause would start at 0.5+0.5*0.67=0.83, correspondingto 67% of the way into expiratory time. Conversely, if the duty cycle isset to 20% in a patient with severe obstructive lung disease, features 6through 10 will be skewed or compressed into early expiration,generating an appropriately longer expiratory pause.

The new estimate of the phase is the centroid, in polar coordinates, ofthe above ten rules:${centroid} = {\arctan \quad \left( \frac{\sum{W_{N}\sin \quad \varphi_{N}}}{\sum{W_{N}\cos \quad \varphi_{N}}} \right)}$

The change in phase dφ from the current phase φ to the centroid iscalculated in polar coordinates. Thus if the centroid is 0.01 and thecurrent phase is 0.99, the change in phase is dφ=0.02. Conversely, ifthe centroid is 0.99 and the current phase is 0.01, then dφ=−0.02. Thenew phase is then set to the centroid:

φ=centroid

This concludes the calculation of the instantaneous phase in therespiratory cycle φ.

Estimated Mean Duration of Inspiration, Expiration, Cycle Time, andRespiratory Rate.

If the current phase is inspiratory (φ<0.5) the estimated duration ofinspiration T_(I) is updated:

LP(dφ_(I))=low pass filtered dφ with a time constant of 4*STD T _(TOT)

Clip LP(dφ_(I)) to the range (0.5/STD T _(I))/2 to 4(0.5/STD T _(I))

T _(I)=0.5/clipped LP(dφI)

Conversely, if the current phase is expiratory, (φ>=0.5) the estimatedduration of expiration T_(E) is updated:

LP(dφ_(E))=low pass filtered dφ with a time constant of 4*STD T _(TOT)

Clip LP(dφE) to the range (0.5/STD T _(E))/2 to 4(0.5/STD T _(E))

T _(E)=0.5/clipped LP(dφ_(E))

The purpose of the clipping is firstly to prevent division by zero, andalso so that the calculated T_(I) and T_(E) are never more than a factorof 4 shorter or a factor of 2 longer than expected.

Finally, the observed mean duration of a breath T_(TOT) and respiratoryrate RR are:

T _(TOT) =T _(I) +T _(E)

RR=60/T _(TOT)

Resistive Unloading

The resistive unloading is the pressure drop across the patient's upperand lower airways, calculated from the respiratory airflow andresistance values stored in SRAM

ƒ=respiratory airflow truncated to +/−2 L/sec

resistive unloading=airway resistance*ƒ+

upper airway resistance*ƒ²*sign(ƒ)

Instantaneous Elastic Assistance

The purpose of the instantaneous elastic assistance is to provide apressure which balances some or all of the elastic deflating pressuresupplied by the springiness of the lungs and chest wall (instantaneouselastic pressure), plus an additional component required toservo-control the minute ventilation to at least exceed on average apre-set target ventilation. In addition, a minimum swing, alwayspresent, is added to the total. The user-specified parameter elastanceis preset to say 50-75% of the known or estimated elastance of thepatient's lung and chest wall. The various components are calculated asfollows:

Instantaneous Assistance Based on Minimum Pressure Swing Set byPhysician:

instantaneous minimum assistance=minimum swing*Π(φ)

Elastic Assistance Required to Servo Control Ventilation to Equal orExceed Target

The quantity servo swing is the additional pressure modulation amplituderequired to servo-control the minute ventilation to at least equal onaverage a pre-set target ventilation.

Minute ventilation is defined as the total number of liters inspired orexpired per minute. However, we can't wait for a whole minute, or evenseveral seconds, to calculate it, because we wish to be able to preventapneas or hypopneas lasting even a few seconds, and a PI controllerbased on an average ventilation over a few seconds would be eithersluggish or unstable.

The quantity actually servo-controlled is half the absolute value of theinstantaneous respiratory airflow. A simple clipped integral controllerwith no damping works very satisfactorily. The controller gain andmaximum output ramp up over the first few seconds after putting the maskon.

If we have had a sudden increase in mouth leak, airflow will be nonzerofor a long time. A side effect is that the ventilation will be falselymeasured as well above target, and the amount of servo assistance willbe falsely reduced to zero. To prevent this, to the extent that thefuzzy recent peak jamming index is large, we hold the degree of servoassistance at its recent average value, prior to the jamming.

The algorithm for calculating servo swing is as follows:

error=target ventilation−abs(respiratory airflow)/2

servo swing=S error*servo gain*sample interval

clip servo swing to range 0 to 20 cmH₂O*lead-in

set recent servo swing=servo swing low pass filtered with a timeconstant of 25 sec,

clip servo swing to be at most J_(PEAK)*recent servo swing

The instantaneous servo assistance is calculated by multiplying servoswing by the previously calculated pressure waveform template:

instantaneous servo assistance=servo swing*Π(φ)

Estimating Instantaneous Elastic Pressure

The instantaneous pressure required to unload the elastic work ofinspiring against the user-specified elastance is the specifiedelastance times the instantaneous inspired volume. Unfortunately,calculating instantaneous inspired volume simply by integratingrespiratory airflow with respect to time does not work in practice forthree reasons: firstly leaks cause explosive run-away of theintegration. Secondly, the integrator is reset at the start of eachinspiration, and this point is difficult to detect reliably. Thirdly,and crucially, if the patient is making no efforts, nothing will happen.

Therefore, four separate estimates are made, and a weighted averagetaken.

Estimate 1: Exact instantaneous elastic recoil calculated frominstantaneous tidal volume, with a correction for sudden change in leak

The first estimate is the instantaneous elastic recoil of a specifiedelastance at the estimated instantaneous inspired volume, calculated bymultiplying the specified elastance by the integral of a weightedrespiratory airflow with respect to time, reset to zero if therespiratory phase is expiratory. The respiratory airflow is weighted bythe fuzzy negation of the recent peak jamming index J_(PEAK), to partlyameliorate an explosive run-away of the integral during brief periods ofsudden increase in leak, before the leak detector has had time to adaptto the changing leak. In the case where the leak is very steady,J_(PEAK) will be zero, the weighting will be unity, and the inspiredvolume will be calculated normally and correctly. In the case where theleak increases suddenly, J_(PEAK) will rapidly increase, the weightingwill decrease, and although typically the calculated inspired volumewill be incorrect, the over-estimation of inspired volume will beameliorated. Calculations are as follows:

Instantaneous volume=integral of respiratory airflow*(I-J _(PEAK)) dt

if phase is expiratory (0.5<φ<1.0 revolutions) reset integral to zero

estimate 1=instantaneous volume*elastance

Estimate 2: Based on Assumption that the Tidal Volume Equals the TargetTidal Volume

The quantity standard swing is the additional pressure modulationamplitude that would unload the specified elastance for a breath of apreset target tidal volume.

target tidal volume=target ventilation/target frequency

standard swing=elastance*target tidal volume

estimate 2=standard swing*Π(φ)

Estimate 3: based on assumption that the tidal volume equals the targettidal volume divided by the observed mean respiratory rate RR calculatedpreviously

Estimate 3=elastance*target ventilation/RR*Π(φ)

Estimate 4; based on assumption that this breath is much like recentbreaths

The instantaneous assistance based on the assumption that the elasticwork for this breath is similar to that for recent breaths is calculatedas follows;

LP elastic assistance=instantaneous elastic assistance

low pass filtered with a time constant of 2 STD T_(TOT)

estimate 4=LP elastic assistance*Π(φ)/P _(BAR)

The above algorithm works correctly even if Π(φ) is dynamically changedon-the-fly by the user, from square to a smooth or vice versa. Forexample, if an 8 cmH2O square wave (Π_(BAR)=1) adequately assists thepatient, then a sawtooth wave (Π_(BAR)=0.5) will require 16 cmH₂O swingto produce the same average assistance.

Best Estimate of Instantaneous Elastic Recoil Pressure

Next, calculate the pressure required to unload a best estimate of theactual elastic recoil pressure based on a weighted average of the above.If Π(φ) is set to the smoothest setting, the estimate is based equallyon all the above estimates of instantaneous elastic recoil. If Π(φ) is asquare wave, the estimate is based on all the above estimates except forestimate 1, because a square wave is maximal at φ=0, whereas estimate 1is zero at φ=0. Intermediate waveforms are handled intermediately.Quantity smoothness runs from zero for a square wave to 1 for a waveformtime constant of 0.3 or above.

smoothness=waveform time constant/0.3

instantaneous recoil=(smoothness*estimate 1+estimate 2+estimate3+estimate 4)/smoothness+3)

Now add the estimates based on minimum and servo swing, truncate so asnot to exceed a maximum swing set by the user. Reduce (lead ingradually) if the mask has only just been put on.

I=instantaneous minimum assistance+instantaneous servoassistance+instantaneous recoil

Truncate I to be less than preset maximum permissible swinginstantaneous elastic assistance=I*lead-in

This completes the calculation of instantaneous elastic assistance.

Desired Pressure at Sensor

desired sensor pressure=epap+hose pressure loss+resistiveunloading+instantaneous elastic assistance

Servo Control of Motor Speed

In the final step, the measured pressure at the sensor isservo-controlled to equal the desired sensor pressure, using for examplea clipped pseudodifferential controller to adjust the motor current.Reference can be made to FIG. 1 in this regard.

Device Performance

FIGS. 21-27 each show an actual 60 second recording displaying an aspectof the second embodiment. All recordings are from a normal subjecttrained to perform the required manoeuvres. Calculated respiratoryairflow, mask pressure, and respiratory phase are calculated using thealgorithms disclosed above, output via a serial port, and plotteddigitally.

In FIGS. 21-26 respiratory airflow is shown as the darker racing, thevertical scale for flow being ± L/sec, inspiration upwards. The verticalscale for the pressure (light trace) is 0.2 cmH₂O.

FIG. 21 is recorded with the servo gain set to 0.1 CmH₂O/L/sec/sec,which is suitable for subjects with normal chemoflexes. The subject isbreathing well above the minimum ventilation, and a particularly deepbreath (sigh) is taken at point (a). As is usual, respiratory effortceases following the sigh, at point (c). The device correctly permits ashort central apnea (b), as indicated by the device remaining at the endexpiratory pressure during the period marked (b). Conversely FIG. 22shows that if there is no preceding deep breath, when efforts cease at(a), the pressure correctly continues to cycle, thus preventing anyhypoxia. FIG. 23 is recorded with servo gain set high, as would beappropriate for a subject with abnormally high chemoreflexes such as istypically the case with Cheyne-Stokes breathing. Now when effort ceasesat arrow (a), pressure continues to cycle and a central apnea is nolonger permitted, despite preceding deep breathing. This is advantageousfor preventing the next cycle of Cheyne-Stokes breathing.

The above correct behaviour is also exhibited by a time mode device, butis very different to that of a spontaneous mode bilevel device, orequally of proportional assist ventilation, both of which would fail tocycle air all central apneas, regardless of appropriateness.

FIG. 24 shows automatically increasing end-inspiratory pressure as thesubject makes voluntarily deeper inspiratory efforts. The desirablebehaviour is in common with PAV, but is different to that of a simplebilevel device, which would maintain a constant level of support despitean increased patient requirement, or to a volume cycled device, whichwould actually decrease support at a time of increasing need.

FIG. 25 is recorded with a somewhat more square waveform selected. Thisfigure shows automatically increasing pressure support when the subjectvoluntarily attempts to resist by stiffening the chest wall at point(a). This desirable behaviour is common with PAV and volume cycleddevices, with the expectation that PAV cannot selectively deliver asquarer waveform. It is distinct from a simple bilevel device whichwould not augment the level of support with increasing need.

FIG. 26 shows that with sudden onset of a severe 1.4 L/sec leak at (a),the flow signal returns to baseline (b) within the span of a singlebreath, and pressure continues to cycle correctly throughout. Althoughtimed mode devices can also continue to cycle correctly in the face ofsudden changing leak, the are unable to follow the subject's respiratoryrate when required (as shown in FIG. 27). Other known bilevel devicesand PAV mis-trigger for longer or shorter periods following onset of asudden sever leak, and PAV can deliver greatly excessive pressures underthese conditions.

FIG. 27 shows an actual 60 second tracing showing respiratory airflow(heavy trace ±1 L/sec full scale) and respiratory phase as a continuousvariable (light trace, 0 to 1 revolution), with high respiratory rate inthe left half of the trace and low respiratory rate in the right half ofthe trace. This trace demonstrates that the invention can determinephase as a continuous variable.

Advantageous Aspects of Embodiments of the Invention.

Use of Phase as a Continuous Variable.

In the prior art, phase is taken as a categorical variable, with twovalues: inspiration and expiration. Errors in the detection of start ofinspiration and start of expiration produce categorical errors indelivered pressure. Conversely, here, phase is treated as a copiousvariable having values between zero and unity. Thus categorical errorsin measurement of phase are avoided.

Adjustable Filter Frequency and Allowance for Phase Delay

By using a short time constant when the subject is breathing rapidly,and a long time constant when the subject is breathing slowly, thefilter introduces a fixed phase delay which is always a small fractionof a respiratory cycle. Thus unnecessary phase delays can be avoided,but cardiogenic artifact can be rejected in subjects who are breathingslowly. Furthermore, because phase is treated as a continuous variable,it is possible to largely compensate for the delay in the low passfilter.

Within-breath Pressure Regulation as a Continuous Function ofRespiratory Phase

With all prior art there is an intrusive discontinuous change inpressure, either at the start of inspiration or at the start ofexpiration. Here, the pressure change is continuous, and therefore morecomfortable.

With proportional assist ventilation, the instantaneous pressure is afunction of instantaneous volume into the breath. This means that asudden large leak can cause explosive pressure run-away. Here, whereinstantaneous pressure is a function of instantaneous phase rather thantidal volume, this is avoided.

Between-breath Pressure-regulation as a Function of Average InspiratoryDuration

Average inspiratory duration is easier to calculate in the presence ofleak than is tidal volume. By taking advantage of a correlation betweenaverage inspiratory duration and average tidal volume, it is possible toadjust the amplitude of modulation to suit the average tidal volume.

Provision of a Pressure Component for Unloading Turbulent Upper AirwayResistance, and Avoiding Cardiogenic Pressure Instabilities

Although Younes describes the use of a component of pressureproportional to the square of respiratory airflow to unload theresistance of external apparatus, the resistance of the externalapparatus in embodiments of the present invention is typicallynegligible. Conversely, embodiments of the present invention describestwo uses for such a component proportional to the square of respiratoryairflow that were not anticipated by Younes. Firstly, sleeping subjects,and subjects with a blocked nose, have a large resistance proportionalto the square of airflow, and a pressure component proportional to thesquare of airflow can be used to unload the anatomical upper airwayresistance. Secondly, small nonrespiratory airflow components due toheartbeat or other artifact, when squared, produces negligible pressuremodulation, so that the use of such a component yields relative immunityto such nonrespiratory airflow.

Smooth Transition Between Spontaneous and Controlled Breathing

There is a smooth, seamless gradation from flexibly tracking thesubject's respiratory pattern during spontaneous breathing well abovethe target ventilation, to fully controlling the duration, depth, andphase of breathing if the subject is making no efforts, via atransitional period in which the subject can make progressively smallerchanges to the timing and depth of breathing. A smooth transition avoidscategorization errors when ventilation is near but not at the desiredthreshold. The advantage is that the transition from spontaneous tocontrolled ventilation occurs unobtrusively to the subject. This can beespecially important in a subject attempting to go to sleep. A similarsmooth transition can occur in the reverse direction, as a subjectawakens and resumes spontaneous respiratory efforts.

What is claimed is:
 1. A method for determining an instantaneous elasticrecoil pressure comprising the steps of: specifying an elastance for asubject; providing the subject with ventilatory support; determining ameasure of respiratory airflow; determining an index value representingan extent to which a leak is suddenly changing using said measure ofrespiratory airflow; calculating an inspired volume of airflow as afunction of said measure of respiratory airflow and said index valueand; calculating said instantaneous elastic recoil pressure as afunction of said inspired volume and said elastance.
 2. The method ofclaim 1 wherein said elastance is about 50 to 75 percent of thesubject's lung and chest wall elasticity.
 3. The method of claim 2wherein said index value is a fuzzy logic function of the fuzzy extentto which a leak has suddenly increased and the fuzzy extent to which aleak has suddenly decreased.
 4. The method of claim 3 wherein (a) saidfuzzy logic function is the fuzzy negation of a peak fuzzy union of saidfuzzy extent to which a leak has suddenly increased and said fuzzyextent to which a leak has suddenly decreased; and (b) said function ofsaid measure of respiratory airflow and said index value is an integralof a product of said measure and a function of said index value.
 5. Anapparatus for determining an instantaneous elastic recoil pressureduring the provision of respiratory assistance comprising: an air supplymeans controllable to supply breathable air to a subject's airwaycontinually at a selectable pressure elevated above atmospheric pressureas a function of an instantaneous elastic pressure; a flow sensor meansto generate a flow signal representative of respiratory airflow; and aprocessor means to process a flow signal from said flow sensor and tocontrol said air supply means, wherein said processor is programmed to:receive as input an elastance value for a subject; calculate an indexvalue representing an extent to which any leak is suddenly changingusing sampled flow values from said flow signal; calculating an inspiredvolume of airflow as a function of said measure of respiratory airflowand said index value; and calculating said instantaneous elastic recoilpressure as a function of said inspired volume and said elastance value.6. The apparatus of claim 5 wherein said index value is calculated froma fuzzy logic function of the fuzzy extent to which said flow samplesindicate that a leak has suddenly increased and the fuzzy extent towhich said flow samples indicate a leak has suddenly decreased.
 7. Theapparatus of claim 6 wherein (a) said fuzzy logic function is the fuzzynegation of a peak fuzzy union of said fuzzy extent to which a leak hassuddenly increased and said fuzzy extent to which a leak has suddenlydecreased; and (b) said function of said measure of respiratory airflowand said index value is an integral of a product of said measure and afunction of said index value.
 8. An apparatus for determining aninstantaneous elastic recoil pressure during the provision ofrespiratory assistance comprising: a blower and mask to supplybreathable air to a subject's airway continually at a selectablepressure elevated above atmospheric pressure as a function of aninstantaneous elastic pressure; a pressure transducer to generate a flowsignal representative of respiratory airflow; and a processor to processa flow signal from said pressure transducer and to control said blower,wherein said processor is programmed to: receive as input an elastancevalue for a subject; calculate an index value representing an extent towhich any leak is suddenly changing using sampled flow values from saidflow signal; calculating an inspired volume of airflow as a function ofsaid measure of respiratory airflow and said index value; andcalculating said instantaneous elastic recoil pressure as a function ofsaid inspired volume and said elastance value.
 9. The apparatus of claim8 wherein said index value is calculated from a fuzzy logic function ofthe fuzzy extent to which said flow samples indicate that a leak hassuddenly increased and the fuzzy extent to which said flow samplesindicate a leak has suddenly decreased.
 10. The apparatus of claim 9wherein (a) said fuzzy logic function is the fuzzy negation of a peakfuzzy union of said fuzzy extent to which a leak has suddenly increasedand said fuzzy extent to which a leak has suddenly decreased; and (b)said function of said measure of respiratory airflow and said indexvalue is an integral of a product of said measure and a function of saidindex value.
 11. A method for determining an instantaneous elasticrecoil pressure comprising the steps of: specifying an elastance for asubject; specifying a ventilation target; providing the subject withrespiratory support; calculating a phase index representing a phase inthe subject's respiration; calculating said instantaneous elastic recoilpressure as a function of (a) said elastance, (b) said ventilationtarget, and (c) a function of said phase index.
 12. The method of claim11 wherein said ventilation target is a tidal volume.
 13. The method ofclaim 12 wherein said elastance is about 50 to 75 percent of thesubject's lung and chest wall elasticity.
 14. The method of claim 13wherein said function of said phase index is a waveform template.
 15. Anapparatus for determining an instantaneous elastic recoil pressureduring the provision of respiratory assistance comprising: an air supplymeans controllable to supply breathable air to a subject's airwaycontinually at a selectable pressure elevated above atmospheric pressureas a function of an instantaneous elastic recoil pressure; a flow sensormeans to generate a flow signal representative of respiratory airflow;and a processor means to process a flow signal from said flow sensor andto control said air supply means, wherein said processor is programmedto: accept an elastance value for a subject; accept a ventilationtarget; calculate a phase index representing the instantaneous phase inthe subject's respiration; calculate said instantaneous elastic recoilpressure as a function of (a) said elastance, (b) said ventilationtarget, and (c) a function of said phase index.
 16. The apparatus ofclaim 15 wherein said ventilation target is a tidal volume.
 17. Theapparatus of claim 16 wherein said function of said phase index is awaveform template.
 18. An apparatus for determining an instantaneouselastic recoil pressure during the provision of respiratory assistancecomprising: a blower and mask to supply breathable air to a subject'sairway continually at a selectable pressure elevated above atmosphericpressure as a function of an instantaneous elastic recoil pressure; apressure transducer to generate a flow signal representative ofrespiratory airflow; and a processor to process a flow signal from saidpressure transducer and to control said blower, wherein said processoris programmed to: accept an elastance value for a subject; accept aventilation target; calculate a phase index representing theinstantaneous phase in the subject's respiration; calculate saidinstantaneous elastic recoil pressure as a function of (a) saidelastance, (b) said ventilation target, and (c) a function of said phaseindex.
 19. The apparatus of claim 18 wherein said ventilation target isa tidal volume.
 20. The apparatus of claim 19 wherein said function ofsaid phase index is a waveform template.
 21. A method for determining aninstantaneous elastic recoil pressure comprising the steps of:specifying an elastance for a subject; specifying a ventilation target;providing the subject with respiratory support; calculating a phaseindex representing a phase in the subject's respiration from said flowsignal; calculating the subject's respiratory rate; and calculating saidinstantaneous elastic recoil pressure as a function of (a) theelastance, (b) the ventilation target, (c) the respiratory rate, and (d)a function of the phase index.
 22. The method of claim 21 wherein saidventilation target is a tidal volume.
 23. The method of claim 22 whereinsaid elastance is about 50 to 75 percent of the subject's lung and chestwall elasticity.
 24. The method of claim 23 wherein said function ofsaid phase index is a waveform template.
 25. An apparatus fordetermining an instantaneous elastic recoil pressure during theprovision of respiratory assistance comprising: an air supply meanscontrollable to supply breathable air to a subject's airway continuallyat a selectable pressure elevated above atmospheric pressure as afunction of an instantaneous elastic recoil pressure; a flow sensormeans to generate a flow signal representative of respiratory airflow;and a processor means to process a flow signal from said flow sensor andto control said air supply means, wherein said processor is programmedto: accept an elastance value for a subject; accept a ventilationtarget; calculate a phase index representing a phase in the subject'srespiration using flow values sampled from said flow signal; calculatethe subject's respiratory rate; and calculate said instantaneous elasticrecoil pressure as a function of (a) the elastance, (b) the ventilationtarget, (c) the respiratory rate, and (d) a function of the phase index.26. The apparatus of claim 25 wherein said ventilation target is a tidalvolume.
 27. The apparatus of claim 26 wherein said function of saidphase index is a waveform template.
 28. An apparatus for determining aninstantaneous elastic recoil pressure during the provision ofrespiratory assistance comprising: a blower and mask to supplybreathable air to a subject's airway continually at a selectablepressure elevated above atmospheric pressure as a function of aninstantaneous elastic recoil pressure; a pressure transducer to generatea flow signal representative of respiratory airflow; and a processor toprocess a flow signal from said pressure transducer and to control saidblower, wherein said processor is programmed to: accept an elastancevalue for a subject; accept a ventilation target; calculate a phaseindex representing a phase in the subject's respiration using flowvalues sampled from said flow signal; calculate the subject'srespiratory rate; and calculate said instantaneous elastic recoilpressure as a function of (a) the elastance, (b) the ventilation target,(c) the respiratory rate, and (d) a function of the phase index.
 29. Theapparatus of claim 28 wherein said ventilation target is a tidal volume.30. The apparatus of claim 29 wherein said function of said phase indexis a waveform template.
 31. A method for determining an instantaneouselastic recoil pressure comprising the steps of: providing the subjectwith respiratory support; calculating a phase index representing aninstantaneous phase in the subject's respiration; determininginstantaneous elastic assistance pressure; low pass filtering saidinstantaneous elastic assistance pressure; and calculating saidinstantaneous elastic recoil pressure from a function of the low passfiltered instantaneous elastic assistance pressure and a function of thephase index.
 32. The method of claim 31 wherein said function of thephase index is a ratio of the phase index as applied to a pressurewaveform template function and its mean.
 33. An apparatus fordetermining an instantaneous elastic recoil pressure during theprovision of respiratory assistance comprising: an air supply meanscontrollable to supply breathable air to a subject's airway continuallyat a selectable pressure elevated above atmospheric pressure as afunction of an instantaneous elastic pressure; a flow sensor means togenerate a flow signal representative of respiratory airflow; and aprocessor means to process a flow signal from said flow sensor and tocontrol said air supply means, wherein said processor is programmed to:calculate a phase index representing a phase in the subject'srespiration using flow values sampled from said flow signal; calculatean instantaneous elastic assistance pressure; low pass filter saidinstantaneous elastic assistance pressure; and calculate saidinstantaneous elastic recoil pressure from a function of the low passfiltered instantaneous elastic assistance pressure and a function of thephase index.
 34. The apparatus of claim 33 wherein said function of thephase index is a ratio of the phase index as applied to a pressure wavetemplate function and its mean.
 35. An apparatus for determining aninstantaneous elastic recoil pressure during the provision ofrespiratory assistance comprising: a blower and mask controllable tosupply breathable air to a subject's airway continually at a selectablepressure elevated above atmospheric pressure as a function of aninstantaneous elastic pressure; a pressure transducer to generate a flowsignal representative of respiratory airflow; and a processor to processa flow signal from said pressure transducer and to control said blower,wherein said processor is programmed to: calculate a phase indexrepresenting a phase in the subject's respiration using flow valuessampled from said flow signal; calculate an instantaneous elasticassistance pressure; low pass filter said instantaneous elasticassistance pressure; and calculate said instantaneous elastic recoilpressure from a function of the low pass filtered instantaneous elasticassistance pressure and a function of the phase index.
 36. The apparatusof claim 35 wherein said function of the phase index is a ratio of thephase index as applied to a pressure wave template function and itsmean.
 37. A method for determining an instantaneous elastic assistancepressure during the provision of respiratory support comprising thesteps of: specifying an elastance for a subject; providing the subjectwith ventilatory support; calculating two or more estimated values forinstantaneous elastic recoil pressure as a function of said elastance;calculating a weighted average recoil pressure from a weighted averageof said estimated values; and determining an instantaneous elasticassistance pressure as a function of the weighted average recoilpressure.
 38. The method of claim 37 wherein said weighted average is afunction of a selected pressure waveform.
 39. The method of claim 38wherein said instantaneous elastic assistance pressure is a furtherfunction of a specified minimum pressure swing and a calculatedinstantaneous phase determined from a measure of respiration.
 40. Themethod of claim 39 wherein said instantaneous elastic assistancepressure is a further function of a pressure amplitude for maintainingat least an average target ventilation.
 41. The method of claim 40wherein said average target ventilation is a minute ventilation.
 42. Themethod of claim 41 wherein said elastance is about 29 to 54 percent ofthe subject's lung and chest wall elasticity.
 43. The method of claim 37wherein one of said estimated values of elastic recoil pressure isderived by: determining a measure of respiratory airflow; determining anindex value representing an extent to which any leak is suddenlychanging using said measure of respiratory airflow; calculating aninspired volume of airflow as an integral of a function of said indexvalue and said measure of respiratory airflow; and calculating anestimated value of elastic recoil pressure as a function of saidinspired volume and said elastance.
 44. The method of claim 43 whereinone of said estimated values of elastic recoil pressure is derived bythe steps of: determining a target tidal volume; calculating a phaseindex representing a phase in the subject's respiration; and calculatingan estimated value of elastic recoil pressure as a function of (a) saidelastance, (b) said target tidal volume, and (c) a function of the phaseindex.
 45. The method of claim 44 wherein one of said estimated valuesof elastic recoil pressure is derived by the steps of: specifying atarget ventilation; calculating the subject's respiratory rate; andcalculating an estimated value of elastic recoil pressure from afunction of (a) the elastance, (b) the target ventilation, (c) therespiratory rate, and (d) a function of the phase index.
 46. The methodof claim 45 wherein one of said estimated values of elastic recoilpressure is derived by the steps of: low pass filtering a previouslydetermined instantaneous elastic assistance; and calculating anestimated value of elastic recoil pressure from a function of the lowpass filtered instantaneous elastic assistance and a function of thephase index.
 47. An apparatus for determining an instantaneous elasticassistance pressure during the provision of respiratory assistancecomprising: an air supply means controllable to supply breathable air toa patient's airway continually at a selectable pressure elevated aboveatmospheric pressure as a function of an instantaneous elasticassistance pressure value; a flow sensor means to generate a flow signalrepresentative of respiratory airflow; and a processor means to processa flow signal from said flow sensor and to control said air supplymeans, wherein said processor is programmed to: receive as input anelastance value for a patient; calculate two or more estimated elasticrecoil pressure values as a function of said elastance value; calculatea weighted average recoil pressure value from a weighted average of saidestimated values; and determine the instantaneous elastic assistancepressure value as a function of the weighted average recoil pressurevalue.
 48. The apparatus of claim 47 wherein said weighted average is afunction of a selected pressure waveform.
 49. The apparatus of claim 48wherein said instantaneous elastic assistance pressure is a furtherfunction of a specified minimum pressure swing and a calculatedinstantaneous phase value determined using flow values sampled from saidflow signal.
 50. The apparatus of claim 49 wherein said instantaneouselastic assistance pressure is a further function of a pressureamplitude for maintaining at least an average target ventilation. 51.The apparatus of claim 50 wherein said average target ventilation is aminute ventilation.
 52. The apparatus of claim 47 wherein one of saidestimated values of elastic recoil pressure is calculated by saidprocessor through the steps of: determining an index value representingan extent to which any leak is suddenly changing using flow valuessampled from said flow signal; calculating an inspired volume of airflowas an integral of a function of said index value and said flow values;and calculating an estimated value of elastic recoil pressure as afunction of said inspired volume and said elastance value.
 53. Theapparatus of claim 52 wherein one of said estimated values of elasticrecoil pressure is calculated by said processor through the steps of:processing a target tidal volume value; calculating a phase indexrepresenting a phase in the subject's respiration using said flowvalues; and calculating an estimated value of elastic recoil pressure asa function of (a) said elastance value, (b) said target tidal volumevalue, and (c) a function of the phase index.
 54. The apparatus of claim53 wherein one of said estimated values of elastic recoil pressure iscalculated by said processor through the steps of: processing a targetventilation value; calculating the subject's respiratory rate; andcalculating an estimated value of elastic recoil pressure from afunction of (a) the elastance value, (b) the target ventilation value,(c) the respiratory rate, and (d) a function of the phase index.
 55. Theapparatus of claim 54 wherein one of said estimated values of elasticrecoil pressure is calculated by said processor through the steps of:low pass filtering a previously determined instantaneous elasticassistance pressure value; and calculating an estimated value of elasticrecoil pressure from a function of the low pass filtered instantaneouselastic assistance value and a function of the phase index.
 56. Anapparatus for determining an instantaneous elastic assistance pressureduring the provision of respiratory assistance comprising: a blower andmask controllable to supply breathable air to a patient's airwaycontinually at a selectable pressure elevated above atmospheric pressureas a function of an instantaneous elastic assistance pressure value; apressure transducer to generate a flow signal representative ofrespiratory airflow; and a processor to process a flow signal from saidpressure transducer and to control said blower, wherein said processoris programmed to: receive as input an elastance value for a patient;calculate two or more estimated elastic recoil pressure values as afunction of said elastance value; calculate a weighted average recoilpressure value from a weighted average of said estimated values; anddetermine the instantaneous elastic assistance pressure value as afunction of the weighted average recoil pressure value.
 57. Theapparatus of claim 56 wherein said weighted average is a function of aselected pressure waveform.
 58. The apparatus of claim 57 wherein saidinstantaneous elastic assistance pressure is a further function of aspecified minimum pressure swing and a calculated instantaneous phasevalue determined using flow values sampled from said flow signal. 59.The apparatus of claim 58 wherein said instantaneous elastic assistancepressure is a further function of a pressure amplitude for maintainingat least an average target ventilation.
 60. The apparatus of claim 59wherein said average target ventilation is a minute ventilation.
 61. Theapparatus of claim 56 wherein one of said estimated values of elasticrecoil pressure is calculated by said processor through the steps of:determining an index value representing an extent to which any leak issuddenly changing using flow values sampled from said flow signal;calculating an inspired volume of airflow as an integral of a functionof said index value and said flow values; and calculating an estimatedvalue of elastic recoil pressure as a function of said inspired volumeand said elastance value.
 62. The apparatus of claim 61 wherein one ofsaid estimated values of elastic recoil pressure is calculated by saidprocessor through the steps of: processing a target tidal volume value;calculating a phase index representing a phase in the subject'srespiration using said flow values; and calculating an estimated valueof elastic recoil pressure as a function of (a) said elastance value,(b) said target tidal volume value, and (c) a function of the phaseindex.
 63. The apparatus of claim 62 wherein one of said estimatedvalues of elastic recoil pressure is calculated by said processorthrough the steps of: processing a target ventilation value; calculatingthe subject's respiratory rate; and calculating an estimated value ofelastic recoil pressure from a function of (a) the elastance value, (b)the target ventilation value, (c) the respiratory rate, and (d) afunction of the phase index.
 64. The apparatus of claim 63 wherein oneof said estimated values of elastic recoil pressure is calculated bysaid processor through the steps of: low pass filtering a previouslydetermined instantaneous elastic assistance pressure value; andcalculating an estimated value of elastic recoil pressure from afunction of the low pass filtered instantaneous elastic assistance valueand a function of the phase index.